﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="GiaoViec.aspx.cs" Inherits="ChamCong.Admin.GiaoViec1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <!--Calendar Script-->
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/jscal.css" />
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/border-radius.css" />
    <script type="text/javascript" src="../Scripts/JSCal/js/jscal2.js"></script>
    <script type="text/javascript" src="../Scripts/JSCal/js/lang/vn.js"></script>
    <!--End Calendar-->
    <style type="text/css">
        .style5
        {
            width: 120px;
        }
        .style6
        {
            width: 356px;
        }
        .style7
        {
            width: 192px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <table style="width: 100%;">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <tr>
            <td class="style6" align="center">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table>
                            <tr>
                                <td colspan="2" style="font-weight: bold;">
                                    BẢNG GIAO VIỆC
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Ngày Đầu Tuần:
                                </td>
                                <td class="style7">
                                    <asp:TextBox ID="txtTuNgay" runat="server" Width="70%"></asp:TextBox>
                                    <script type="text/javascript">
                                        // ScriptManager.RegisterStartupScript(\
                                        Cal = new Calendar({
                                            inputField: "txtTuNgay",
                                            dateFormat: "%d/%m/%Y",
                                            trigger: "txtTuNgay",
                                            bottomBar: false,
                                            onSelect: function () { this.hide(); }
                                        });

                                        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(CallCalendar);
                                        function CallCalendar(sender, args) {
                                            $(".button").button();
                                            Cal = new Calendar({
                                                inputField: "txtTuNgay",
                                                dateFormat: "%d/%m/%Y",
                                                trigger: "txtTuNgay",
                                                bottomBar: false,
                                                onSelect: function () { this.hide(); }
                                            });
                                        }
                                    </script>
                                </td>
                                <td>
                                    <asp:Button ID="btnXem" class="button" runat="server" Text="Xem" OnClick="btnXem_Click" />
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:UpdatePanel ID="ud_gvNhanVien" runat="server">
                    <ContentTemplate>
                        <sbc:sbcMsgBox ID="sbcMsgBox1" runat="server" UseJQuery="True" />
                        <asp:GridView ID="gvNhanVien" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvNhanVien_RowDataBound"
                            CellPadding="4" ForeColor="#333333" GridLines="None">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:BoundField DataField="MaGiaoViec" HeaderText="Mã GV" SortExpression="MaNV" />
                                <asp:BoundField DataField="MaNV" HeaderText="Mã NV" SortExpression="MaNV" />
                                <asp:BoundField DataField="HoTen" HeaderText="Họ Tên" SortExpression="HoTen" />
                                <asp:TemplateField HeaderText="Trạng Thái">
                                    <ItemTemplate>
                                        <asp:Label ID="lbTrangThai" runat="server" Text='<%#AutoConvert(Eval("TrangThai"))%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="btnSua" runat="server" Text="Sửa" OnClick="btnSua_Click" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                        <asp:Button ID="btnGiaoViec" class="button" runat="server" Text="Giao Việc" OnClick="btnGiaoViec_Click" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td>
                <asp:UpdatePanel ID="up_gvCTGiaoViec" runat="server">
                    <ContentTemplate>
                        <p>
                            <asp:Label ID="lbHoten" runat="server" Font-Size="15px" ForeColor="Blue" Font-Bold="true" ></asp:Label>
                        </p>
                        <asp:GridView ID="gvCTGiaoViec" runat="server" AutoGenerateColumns="False" OnRowDataBound="gvctGiaoViec_RowDataBound"
                            ShowFooter="True" onrowcommand="gvCTGiaoViec_rowCommand" CellPadding="4" 
                            ForeColor="#333333" GridLines="None">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField HeaderText="Mã">
                                    <ItemTemplate>
                                        <asp:Label ID="lbMaCongViec" runat="server" Text='<%# Eval("MaCongViec") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Công Việc">
                                    <ItemTemplate>
                                        <asp:Label ID="lbTenCongViec" runat="server" Text='<%# Eval("TenCongViec") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox ID="txtTenCongViec" runat="server"></asp:TextBox>
                                    </FooterTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Đơn Vị">
                                    <ItemTemplate>
                                        <asp:Label ID="lbDonVi" runat="server" Text='<%# Eval("DonVi") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:DropDownList ID="drDonVi" runat="server" DataSourceID="DSDonVi" DataTextField="TenDonVi"
                                            DataValueField="MaDonVi">
                                        </asp:DropDownList>
                                        <asp:ObjectDataSource ID="DSDonVi" runat="server" SelectMethod="LayTatCa" TypeName="BusinessLogicLayer.DonViBLL">
                                        </asp:ObjectDataSource>
                                    </FooterTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Chỉ Tiêu">
                                    <ItemTemplate>
                                        <asp:Label ID="lbChiTieu" runat="server" Text='<%# Eval("ChiTieu") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox ID="txtChiTieu" runat="server" Width="50px"></asp:TextBox>
                                    </FooterTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Hệ Số">
                                    <ItemTemplate>
                                        <asp:Label ID="lbHeSo" runat="server" Text='<%# Eval("HeSo") %>'></asp:Label>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <asp:DropDownList ID="drHeSo" runat="server">
                                            <asp:ListItem Value="10">10</asp:ListItem>
                                            <asp:ListItem Value="9">9</asp:ListItem>
                                            <asp:ListItem Value="8">8</asp:ListItem>
                                            <asp:ListItem Value="7">7</asp:ListItem>
                                            <asp:ListItem Value="6">6</asp:ListItem>
                                            <asp:ListItem Value="5">5</asp:ListItem>
                                            <asp:ListItem Value="4">4</asp:ListItem>
                                            <asp:ListItem Value="3">3</asp:ListItem>
                                            <asp:ListItem Value="2">2</asp:ListItem>
                                            <asp:ListItem Value="1">1</asp:ListItem>
                                        </asp:DropDownList>
                                    </FooterTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <FooterTemplate>
                                        <asp:Button ID="btnThem" runat="server" Text="Thêm" CommandName="Them" />
                                    </FooterTemplate>
                                    <ItemTemplate>
                                        <asp:ImageButton ID="imgbtXoa" ImageUrl="~/Scripts/Image/Xoa.jpg" Width="18px" Height="18px"
                                            runat="server" OnClick="imgbtXoa_Click" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <EmptyDataTemplate>
                                <table class="grid" cellpadding="4" cellspacing="0" border="0" id="gvEG" style="border-collapse: collapse;">
                                    <tr style=" background-color:#507CD1; font-weight:bold; color:White;">
                                        <th scope="col">
                                            Mã
                                        </th>
                                        <th scope="col">
                                            Công Việc
                                        </th>
                                        <th scope="col">
                                            Đơn Vị
                                        </th>
                                        <th scope="col">
                                            Chỉ Tiêu
                                        </th>
                                        <th scope="col">
                                            Hệ Số
                                        </th>
                                        <th scope="col">
                                        </th>
                                    </tr>
                                    <tr class="gridRow" style="background-color:White;">
                                        <td colspan="6">
                                            Chưa có công việc ...
                                        </td>
                                    </tr>
                                    <tr class="gridFooterRow" style=" background:#507CD1;">
                                        <td>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtTenCongViec" runat="server"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="drDonVi" runat="server" DataSourceID="DSDonVi" DataTextField="TenDonVi"
                                                DataValueField="MaDonVi">
                                            </asp:DropDownList>
                                            <asp:ObjectDataSource ID="DSDonVi" runat="server" SelectMethod="LayTatCa" TypeName="BusinessLogicLayer.DonViBLL">
                                            </asp:ObjectDataSource>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtChiTieu" runat="server" Width="50px" />
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="drHeSo" runat="server">
                                                <asp:ListItem Value="10">10</asp:ListItem>
                                                <asp:ListItem Value="9">9</asp:ListItem>
                                                <asp:ListItem Value="8">8</asp:ListItem>
                                                <asp:ListItem Value="7">7</asp:ListItem>
                                                <asp:ListItem Value="6">6</asp:ListItem>
                                                <asp:ListItem Value="5">5</asp:ListItem>
                                                <asp:ListItem Value="4">4</asp:ListItem>
                                                <asp:ListItem Value="3">3</asp:ListItem>
                                                <asp:ListItem Value="2">2</asp:ListItem>
                                                <asp:ListItem Value="1">1</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                        <td>
                                            <asp:Button ID="btnThem" runat="server" Text="Thêm" CommandName="emptyThem" />
                                        </td>
                                    </tr>
                                </table>
                            </EmptyDataTemplate>
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                        <sbc:sbcMsgBox ID="sbcMsgBox" runat="server" UseJQuery="True" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</asp:Content>
